#pragma once
#include <map>
#include <utility>
#include <ClanLib/sound.h>
#include "item.h"
#include "object.h"
#include "player.h"
#include "level.h"
#include "enemy.h"

// speichert alle bilder / objekte
// SINGLETON!

class ResourceManager {
public:
	static ResourceManager* getInstance();
	static void destroyInstance();

	void addGameItem(char key, Item* item);
	void addGameObject(char key, Object* object);
	void addGameSound(char key, CL_SoundBuffer* sound);
	void addGameSprite(char key, CL_Sprite* sprite);

	Object* getGameObject(char key);
	Item* getGameItem(char key);
	CL_Sprite* getGameSprite(char key);

	void setPlayer(Player* player);
	Player* getPlayer();

	void setEnemy(Enemy* enemy);
	Enemy* getEnemy();

	Level* getLevel();
	void setLevel(Level* level);
private:
	ResourceManager(void);
	ResourceManager(const ResourceManager&);
	~ResourceManager(void);

	static ResourceManager* instance;

	std::map<char, Item*> itemMap;
	std::map<char, Object*> objectMap;
	std::map<char, CL_Sprite*> graphicsMap;

	bool isPlayerSet;
	Player* player;
	Level* level;
	Enemy* enemy;
};
